import type { ClassInfoResp } from './class'
import http from '@/utils/http'

export interface Student {
  id: string
  createUser: string
  createTime: string
  updateUser: string
  updateTime: string
  name: string
  namePinyin: string
  parentId: string
  parentPhone: string
  parentRelation?: string
  source?: string
  gender?: number
  birthdate?: string
  avatar?: string
  admissionYear?: number
  fulltimeSchool?: string
  enrollStatus?: number
  remark?: string
}

export interface EnrollPermission {
  id: string
  studentId: string
  subject: string
  admissionYear: number
  classLevel: number
  remark: string
}

export interface StudentDetailResp extends Student {
  enrollClassList: ClassInfoResp[]
  permissionList: EnrollPermission[]
}

// 学生档案
export function getStudentDetail(id: string) {
  return http.get<StudentDetailResp>(`/t/student/detail/${id}`)
}
